<template>
	<view class="xiangqing ">
		<view class="topbar padding-sm">
			<view v-if="item!=null" class="dqr text-black padding-bottom-lg">{{list[item.orderType]}}</view>
			
			<view class="flex text-df align-center justify-between margin-tb-sm">
				<view>品牌</view>
				<view>{{item.brandName}}</view>
			</view>
			
			
			<view class="flex align-center justify-between margin-tb-sm">
				<view>型号</view>
				<view>{{item.model}}</view>
			</view>
			
			<view class="flex align-center justify-between margin-tb-sm">
				<view>IMEI</view>
				<view>{{item.imei}}</view>
			</view>
			
			<view class="flex align-center justify-between">
				<view>照片</view>
			</view>
			
			<view class="imag">
				<view class="tup" v-for="item of imageList" :key="item">
					<image :src="item" mode="aspectFill"></image>
				</view>
				
			</view>
			
			<view class="flex align-center justify-between margin-tb-sm">
				<view>备注</view>
				<view>{{item.remarks}}</view>
			</view>
		</view>
		
		<view v-show="item.orderType!=0" class="topbar margin-bottom-sm padding-sm">
			<view class="dqr text-black padding-bottom-lg">回收信息</view>
			<view class="flex align-center justify-between margin-tb-sm">
				<view>回收点</view>
				<view>{{item.shopName}}</view>
			</view>
			<view class=" lxdh flex align-center justify-between margin-tb-sm">
				<view>联系电话</view>
				<view>{{item.tel}}</view>
			</view>
			
			<view class="flex align-end justify-end" style="display: flex;align-items:baseline;">
				<text class="text-black margin-right-sm bj">平台报价:</text>
				<text class="myfh">￥</text>
				<text class="jg">{{item.recoveryPrice?Number(item.recoveryPrice).toFixed(2):0}}</text>
<!-- 				<text class="jg">{{Number(item.recoveryPrice?item.recoveryPrice:0).toFixed(2)}}</text> -->
			</view>
		</view>
		
		<view style="margin-bottom: 200rpx;" class="topbar margin-bottom-sm padding-sm">
			<view class="dqr text-black padding-bottom-lg">联系我们</view>
			<view class="flex align-center justify-between margin-tb-sm">
				<view>员工名称</view>
				<view>{{user.staffName}}</view>
			</view>
			<view class="flex align-center justify-between margin-tb-sm">
				<view>手机号</view>
				<view>{{user.tel}}</view>
			</view>
			<view class="flex align-center justify-between margin-tb-sm">
				<view>门店名称</view>
				<view>{{user.merchantName}}</view>
			</view>
			<view class="flex align-center justify-between margin-tb-sm">
				<view>商户名称</view>
				<view>{{user.shopName}}</view>
			</view>
			<view class="flex align-center justify-between margin-tb-sm">
				<view>战区名称</view>
				<view>{{item.zoneName}}</view>
			</view>
		</view>
		
		<view class="bg-white dibu">
			<button class="cu-btn round"> 取消 </button>
			<button class="cu-btn round"> 拒绝 </button>
			<button class="cu-btn round"> 确认 </button>
			</view>
	</view>
</template>

<script>
	import {getXiangQin,getUserInfo} from '../../api/index.js'
	export default {
		data() {
			return {
				item:null,
				list:[
					'待报价',
					'待确认',
					'待付款',
					'待发货',
					'已驳回',
					'取消审核',
					'已取消',
					'已完成',
				],
				imageList:[],
				orderId:null,
				user:null
			}
		},
		onLoad(options){
			this.orderId = options.orderId
			// getXiangQin(orderId).then(res=>{
			// 	this.item = res
			// 	  this.imageList = res.img.split(',')
			// })
			
		},
		onShow(){
			getXiangQin(this.orderId).then(res=>{
				this.item = res
				this.imageList = res.img.split(',')
				getUserInfo(res.tel).then(res1=>{
					this.user = res1
				})
			})
			
		},
		methods: {
			
		}
	}
</script>

<style>
	.topbar{
		width: 686rpx;
		margin: 0 auto 20rpx;
		border-radius: 24rpx;
		background-color: #fff;
	}
	
	.dqr{
		font-size: 32rpx;
		font-weight: 700;
		border-bottom: 1px solid #f6f6f6;
	}
	
	.imag{
		display: flex;
		flex-wrap: wrap;
		justify-content: space-around;
	}
	
	.tup{
		width: 202rpx;
		height: 202rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.tup image{
		width: 100%;
		height: 100%;
	}
	
	.lxdh{
		border-bottom: 1px solid #f6f6f6;
		padding-bottom: 40rpx;
	}
	
	.bj{
		font-weight: 700;
		font-size: 32rpx;
	}
	
	.myfh{
		font-size: 28rpx;
		color: #FF4000;
	}
	
	.jg{
		font-size: 48rpx;
		color: #FF4000;
	}
	
	.dibu{
		position: fixed;
		width: 100%;
		left: 0;
		bottom: 0;
		height: 188rpx;
		border-radius: 16rpx 16rpx 0 0;
		border: 1px solid red;
		display: none;
	}
	button{
		width: 176rpx;
		height: 72rpx;
	}
</style>
